<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<jsp:include page="common/header.jsp"></jsp:include>
<input type="hidden" name="projectName" id="projectName" value="${pageContext.request.contextPath }"/>
<h1>
	<img src="${pageContext.request.contextPath}/views/images/icons/posts.png" alt="" /> 模块管理
</h1>

<div class="bloc">
	<div class="title">修改模块</div>
	<div class="content">
		<div class="input">
			<label for="input1">模块编号</label> <input type="text" id="module_id" value="${module.id }" />
		</div>
		<div class="input">
			<label for="input1">模块名称</label> <input type="text" id="module_name" value="${module.name }" />
		</div>
		<div class="input">
			<label for="input1">模块链接</label> <input type="text" id="module_link" value="${module.link }" />
		</div>
		<div class="input">
			<label for="input1">模块描述</label> <input type="text" id="module_description" value="${module.description }" />
		</div>
		<input type="hidden" id="module_typeid" value="${module.type }"/>
		<div class="input">
			<label for="input1">模块类型</label>
			<select name="select" id="module_type">
				<option value="-1" onclick="javascript:decidepid0(-1);"></option>
                <option value="0" onclick="javascript:decidepid0(0);" <c:if test="${ not empty module.type && module.type == 0 }">selected="selected"</c:if>>一级菜单</option>
                <option value="1" onclick="javascript:decidepid0(1);" <c:if test="${ not empty module.type && module.type == 1 }">selected="selected"</c:if>>二级菜单</option>
            </select>
		</div>
		<div class="input">
			<label for="input1">上级菜单（自动带出）</label> <input type="text" id="module_pid0" value="${pName }" readonly/>
		</div>


		<div class="submit" style="margin-top: 20px;">
			<input type="button" value="保存" onclick="javascript:updatemodule();" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="button" value="取消" class="white"
				onclick="javascript:location.href='${pageContext.request.contextPath}/admin-module/index';" />
		</div>
	</div>
</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/views/js/module_update.js"></script>
<script type="text/javascript">

$(function(){
	var selText = $('#module_type').find('option:selected').text();
	$('#module_type').prev('span').html(selText);
})
</script>